/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package persistence;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLDataException;
import java.sql.SQLException;

/**
 *
 * @author Cristian
 */
public class DataBaseLocator {
    //Padrao singleton retorna apenas uma instancia do objeto
    private static DataBaseLocator instance = new DataBaseLocator();
    public static DataBaseLocator getInstace(){
     return instance;
    }
    
    private DataBaseLocator(){
    }
    
    public  Connection getConnection() throws SQLDataException, ClassNotFoundException, SQLException
    {
     Class.forName("com.mysql.jdbc.Driver");
        Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/projetobanco", "root", "");
        return conn;
    }
}
